package com.example.config;

import com.example.entity.Order;
import com.example.entity.Win10;
import org.springframework.context.annotation.*;

/**
 * @author mingtian
 * @version V1.0
 * @Description
 * @EnableLogInfo 项目启动时将 LogInfo 类注入到 SpringIOC 容器中
 * @ComponentScan("com.example.entity") //开启扫包范围
 * @date 2019/12/9 11:17
 */
@Import({Order.class, MyImportSelector.class, MyImportBeanDefinitionRegistrar.class})
@Configuration
@EnableLogInfo
@ComponentScan("com.example")
public class MyConfig {

    /**
     * 将 win10 注入 Spring 容器中
     *
     * @return
     */
    @Bean
    @Conditional(MyCondition.class)
    public Win10 win10() {
        return new Win10();
    }

    /**
     * 将 myFactoryBean 注入 Spring 容器中
     *
     * @return
     */
    @Bean
    public MyFactoryBean myFactoryBean() {
        return new MyFactoryBean();
    }
}


